import { h } from 'vue';
import { NTag } from 'naive-ui';

export const columns = [
  {
    title: '字典名称',
    key: 'dictName',
  },
  {
    title: '分组标识',
    key: 'dictGroup',
  },
  {
    title: '字典KEY',
    key: 'dictKey',
  },
  {
    title: '字典字典值',
    key: 'dictValue',
  },
  {
    title: '字典说明',
    key: 'dictDesc',
  },
  {
    title: '状态',
    key: 'deleted',
    render(row) {
      return h(
        NTag,
        {
          type: row.deleted === 0 ? 'success' : 'error',
        },
        {
          default: () => (row.deleted === 0 ? '启用' : '禁用'),
        }
      );
    },
  },
];
